from django.conf import settings
from django.urls import path, include, re_path
import xadmin
from django.views.static import serve
from rest_framework.documentation import include_docs_urls

xadmin.autodiscover()
from xadmin.plugins import xversion

xversion.register_models()

urlpatterns = [
    path('xadmin/', xadmin.site.urls),

    # 接口文档
    path('docs/', include_docs_urls(title='站点页面标题')),

    path('home/', include('home.urls')),
    path('user/', include('user.urls')),
    path('book/', include('book.urls')),
    path('order/', include('order.urls')),
    path('recharge/', include('recharge.urls')),
    re_path('media/(?P<path>.*)', serve, {'document_root': settings.MEDIA_ROOT}),
]
